#! /usr/bin/python

count = 0
ht = 20
next = 30
total = ht + ht * 5

print "N under 10e3:", total
total += ht*next
print "N under 10e4:", total
print "N under 10e5, no answer"

#10e6
count = 0
for a0 in (2, 4, 6, 8):
    for a1 in range(10):
	for a2 in range(10):
	    for a3 in range(5):
		for a4 in range(10):
		    if a2 + a4 < 10: continue
		    if (a2 + a4)%2 == 0: continue
		    for a5 in range(10):
		       if a1 + a5 >= 10: break
		       if (a1 + a5)%2 != 0: continue
		       for a6 in (3, 5, 7, 9):
			   if a0+a6 >= 10: count += 2
print count
total += count

print total + 20*30*30*30 + 20*30*30
